import request from '@/utils/request'
// 获取分类列表
export function getCategoriesList(params) {
  return request({
    url: '/categories',
    params
  })
}
// 添加分类
export function addCategories(data) {
  return request({
    url: '/categories',
    method: 'post',
    data
  })
}
// 获取分类数量
export function getCategoriesCount(params) {
  return request({
    url: '/categories/count',
    params
  })
}
// 获取指定分类
export function getCategoriesByID(id) {
  return request({
    url: `/categories/${id}`
  })
}
// 编辑分类
export function editCategories(data) {
  return request({
    url: '/categories/' + data.id,
    method: 'put',
    data
  })
}
// 删除分类
export function defCategories(id) {
  return request({
    url: `/categories/${id}`,
    method: 'delete'
  })
}
